<?php
class Article extends MY_Controller{
	function hot_list(){
		$this->load->model("Articles");
		$hot_list = $this->Articles->get_hot_article_list();
		echo json_encode(array("code" => 1, "data" => $hot_list));
	}

	function detail(){
		$data = $this->user_post_data;
		$article_info = get_field_by_where("articles", "*", "id='{$data['article_id']}'");
		if($article_info){
			$article_info['add_time'] = date("Y-m-d", $article_info['add_time']);
			echo json_encode(array("code" => 1, "data" => $article_info));
		}else{
			echo json_encode(array("code" => 0, "msg" => '资讯不存在'));
		}
	}
}